<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Header File Template: cmsis_os.h</title>
<title>CMSIS-RTOS: Header File Template: cmsis_os.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="stylsheetf" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-RTOS
   &#160;<span id="projectnumber">Version 1.02</span>
   </div>
   <div id="projectbrief">CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.2 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li><a href="modules.html"><span>Reference</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('cmsis_os_h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Header File Template: <a class="el" href="cmsis__os_8h.html">cmsis_os.h</a> </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The file <b><a class="el" href="cmsis__os_8h.html">cmsis_os.h</a></b> is a template header file for a CMSIS-RTOS compliant Real-Time Operating System (RTOS). Each RTOS that is compliant with CMSIS-RTOS shall provide a specific <b><a class="el" href="cmsis__os_8h.html">cmsis_os.h</a></b> header file that represents its implementation.</p>
<p>The file <a class="el" href="cmsis__os_8h.html">cmsis_os.h</a> contains:</p>
<ul>
<li>CMSIS-RTOS API function definitions</li>
<li>struct definitions for parameters and return types</li>
<li>status and priority values used by CMSIS-RTOS API functions</li>
<li>macros for defining threads and other kernel objects</li>
</ul>
<p><b>Name conventions and header file modifications</b></p>
<p>All definitions are prefixed with <b>os</b> to give an unique name space for CMSIS-RTOS functions. Definitions that are prefixed <b>os_</b> are not used in the application code but local to this header file. All definitions and functions that belong to a module are grouped and have a common prefix, i.e. <b>osThread</b>.</p>
<p>Definitions that are marked with <b>CAN BE CHANGED</b> can be adapted towards the needs of the actual CMSIS-RTOS implementation. These definitions can be specific to the underlying RTOS kernel.</p>
<p>Definitions that are marked with <b>MUST REMAIN UNCHANGED</b> cannot be altered. Otherwise the CMSIS-RTOS implementation is no longer compliant to the standard. Note that some functions are optional and need not to be provided by every CMSIS-RTOS implementation.</p>
<p><b>Define and reference object definitions</b></p>
<p>With <b>#define osObjectsExternal</b> objects are defined as external symbols. This allows to create a consistent header file that is used throughout a project as shown below:</p>
<p><em>Header File</em> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&gt;</span>                                         <span class="comment">// CMSIS RTOS header file</span></div>
<div class="line"></div>
<div class="line"><span class="comment">// Thread definition</span></div>
<div class="line"><span class="keyword">extern</span> <span class="keywordtype">void</span> thread_sample (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument);             <span class="comment">// function prototype</span></div>
<div class="line"><a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gaee93d929beb350f16e5cc7fa602e229f" title="Create a Thread Definition with function, priority, and stack requirements.">osThreadDef</a> (thread_sample, <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6" title="priority: below normal">osPriorityBelowNormal</a>, 1, 100);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Pool definition</span></div>
<div class="line"><a class="code" href="group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga87b471d4fe2d5dbd0040708edd52771b" title="Define a Memory Pool.">osPoolDef</a>(MyPool, 10, <span class="keywordtype">long</span>);</div>
</div><!-- fragment --><p>This header file defines all objects when included in a C/C++ source file. When <b>#define osObjectsExternal</b> is present before the header file, the objects are defined as external symbols. A single consistent header file can therefore be used throughout the whole project.</p>
<p><em>Example</em> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;osObjects.h&quot;</span>     <span class="comment">// Definition of the CMSIS-RTOS objects</span></div>
</div><!-- fragment --><div class="fragment"><div class="line"><span class="preprocessor">#define osObjectsExternal  // Objects will be defined as external symbols</span></div>
<div class="line"><span class="preprocessor">#include &quot;osObjects.h&quot;     // Reference to the CMSIS-RTOS objects</span></div>
</div><!-- fragment --><p><b>Header file cmsis_os.h</b></p>
<div class="fragment"><div class="line"><span class="comment">/* ----------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * $Date:        5. February 2013</span></div>
<div class="line"><span class="comment"> * $Revision:    V1.02</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Project:      CMSIS-RTOS API</span></div>
<div class="line"><span class="comment"> * Title:        cmsis_os.h template header file</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Version 0.02</span></div>
<div class="line"><span class="comment"> *    Initial Proposal Phase</span></div>
<div class="line"><span class="comment"> * Version 0.03</span></div>
<div class="line"><span class="comment"> *    osKernelStart added, optional feature: main started as thread</span></div>
<div class="line"><span class="comment"> *    osSemaphores have standard behavior</span></div>
<div class="line"><span class="comment"> *    osTimerCreate does not start the timer, added osTimerStart</span></div>
<div class="line"><span class="comment"> *    osThreadPass is renamed to osThreadYield</span></div>
<div class="line"><span class="comment"> * Version 1.01</span></div>
<div class="line"><span class="comment"> *    Support for C++ interface</span></div>
<div class="line"><span class="comment"> *     - const attribute removed from the osXxxxDef_t typedef&#39;s</span></div>
<div class="line"><span class="comment"> *     - const attribute added to the osXxxxDef macros</span></div>
<div class="line"><span class="comment"> *    Added: osTimerDelete, osMutexDelete, osSemaphoreDelete</span></div>
<div class="line"><span class="comment"> *    Added: osKernelInitialize</span></div>
<div class="line"><span class="comment"> * Version 1.02</span></div>
<div class="line"><span class="comment"> *    Control functions for short timeouts in microsecond resolution:</span></div>
<div class="line"><span class="comment"> *    Added: osKernelSysTick, osKernelSysTickFrequency, osKernelSysTickMicroSec</span></div>
<div class="line"><span class="comment"> *    Removed: osSignalGet </span></div>
<div class="line"><span class="comment"> *----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Copyright (c) 2013 ARM LIMITED</span></div>
<div class="line"><span class="comment"> * All rights reserved.</span></div>
<div class="line"><span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><span class="comment"> * modification, are permitted provided that the following conditions are met:</span></div>
<div class="line"><span class="comment"> *  - Redistributions of source code must retain the above copyright</span></div>
<div class="line"><span class="comment"> *    notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><span class="comment"> *  - Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><span class="comment"> *    notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><span class="comment"> *    documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><span class="comment"> *  - Neither the name of ARM  nor the names of its contributors may be used</span></div>
<div class="line"><span class="comment"> *    to endorse or promote products derived from this software without</span></div>
<div class="line"><span class="comment"> *    specific prior written permission.</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;</span></div>
<div class="line"><span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
<div class="line"><span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE</span></div>
<div class="line"><span class="comment"> * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
<div class="line"><span class="comment"> * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
<div class="line"><span class="comment"> * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
<div class="line"><span class="comment"> * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
<div class="line"><span class="comment"> * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
<div class="line"><span class="comment"> * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><span class="comment"> * POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifndef _CMSIS_OS_H</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define _CMSIS_OS_H</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osCMSIS identifies the CMSIS-RTOS API version.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osCMSIS           0x10002      </span><span class="comment">///&lt; API version (main [31:16] .sub [15:0])</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b osCMSIS_KERNEL identifies the underlying RTOS kernel and version number.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osCMSIS_KERNEL    0x10000          </span><span class="comment">///&lt; RTOS identification and version (main [31:16] .sub [15:0])</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osKernelSystemId shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osKernelSystemId &quot;KERNEL V1.00&quot;   </span><span class="comment">///&lt; RTOS identification string</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osFeature_xxx shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osFeature_MainThread   1       </span><span class="comment">///&lt; main thread      1=main can be thread, 0=not available</span></div>
<div class="line"><span class="comment"></span>#define osFeature_Pool         1       <span class="comment">///&lt; Memory Pools:    1=available, 0=not available</span></div>
<div class="line"><span class="comment"></span>#define osFeature_MailQ        1       <span class="comment">///&lt; Mail Queues:     1=available, 0=not available</span></div>
<div class="line"><span class="comment"></span>#define osFeature_MessageQ     1       <span class="comment">///&lt; Message Queues:  1=available, 0=not available</span></div>
<div class="line"><span class="comment"></span>#define osFeature_Signals      8       <span class="comment">///&lt; maximum number of Signal Flags available per thread</span></div>
<div class="line"><span class="comment"></span>#define osFeature_Semaphore    30      <span class="comment">///&lt; maximum count for \ref osSemaphoreCreate function</span></div>
<div class="line"><span class="comment"></span>#define osFeature_Wait         1       <span class="comment">///&lt; osWait function: 1=available, 0=not available</span></div>
<div class="line"><span class="comment"></span>#define osFeature_SysTick      1       <span class="comment">///&lt; osKernelSysTick functions: 1=available, 0=not available</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stddef.h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifdef  __cplusplus</span></div>
<div class="line"><span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span></div>
<div class="line">{</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Enumeration, structures, defines ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Priority used for thread control.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osPriority shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span>  {</div>
<div class="line">  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa549e79a43ff4f8b2b31afb613f5caa81" title="priority: idle (lowest)">osPriorityIdle</a>          = -3,          <span class="comment">///&lt; priority: idle (lowest)</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa61cb822239ac8f66dfbdc7291598a3d4" title="priority: low">osPriorityLow</a>           = -2,          <span class="comment">///&lt; priority: low</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6" title="priority: below normal">osPriorityBelowNormal</a>   = -1,          <span class="comment">///&lt; priority: below normal</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1" title="priority: normal (default)">osPriorityNormal</a>        =  0,          <span class="comment">///&lt; priority: normal (default)</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa17b36cd9cd38652c2bc6d4803990674b" title="priority: above normal">osPriorityAboveNormal</a>   = +1,          <span class="comment">///&lt; priority: above normal</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2" title="priority: high">osPriorityHigh</a>          = +2,          <span class="comment">///&lt; priority: high</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa1485dec3702434a1ec3cb74c7a17a4af" title="priority: realtime (highest)">osPriorityRealtime</a>      = +3,          <span class="comment">///&lt; priority: realtime (highest)</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aae35f5e2f9c64ad346822521b643bdea4" title="system cannot determine priority or thread has illegal priority">osPriorityError</a>         =  0x84        <span class="comment">///&lt; system cannot determine priority or thread has illegal priority</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Timeout value.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osWaitForever shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osWaitForever     0xFFFFFFFF     </span><span class="comment">///&lt; wait forever timeout value</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// Status code values returned by CMSIS-RTOS functions.</span></div>
<div class="line"><span class="comment"></span><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osStatus shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span>  {</div>
<div class="line">  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f" title="function completed; no error or event occurred.">osOK</a>                    =     0,       <span class="comment">///&lt; function completed; no error or event occurred.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518" title="function completed; signal event occurred.">osEventSignal</a>           =  0x08,       <span class="comment">///&lt; function completed; signal event occurred.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342" title="function completed; message event occurred.">osEventMessage</a>          =  0x10,       <span class="comment">///&lt; function completed; message event occurred.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926" title="function completed; mail event occurred.">osEventMail</a>             =  0x20,       <span class="comment">///&lt; function completed; mail event occurred.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea78f477732375c0e1fca814e369618177" title="function completed; timeout occurred.">osEventTimeout</a>          =  0x40,       <span class="comment">///&lt; function completed; timeout occurred.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eac24adca6a5d072c9f01c32178ba0d109" title="parameter error: a mandatory parameter was missing or specified an incorrect object.">osErrorParameter</a>        =  0x80,       <span class="comment">///&lt; parameter error: a mandatory parameter was missing or specified an incorrect object.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea8fc5801e8b0482bdf22ad63a77f0155d" title="resource not available: a specified resource was not available.">osErrorResource</a>         =  0x81,       <span class="comment">///&lt; resource not available: a specified resource was not available.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea314d24a49003f09459035db0dd7c9467" title="resource not available within given time: a specified resource was not available within the timeout p...">osErrorTimeoutResource</a>  =  0xC1,       <span class="comment">///&lt; resource not available within given time: a specified resource was not available within the timeout period.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea21635bdc492d3094fe83027fa4a30e2f" title="not allowed in ISR context: the function cannot be called from interrupt service routines.">osErrorISR</a>              =  0x82,       <span class="comment">///&lt; not allowed in ISR context: the function cannot be called from interrupt service routines.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eaf6552310a817452aedfcd453f2805d65" title="function called multiple times from ISR with same object.">osErrorISRRecursive</a>     =  0x83,       <span class="comment">///&lt; function called multiple times from ISR with same object.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eab7dda0ef504817659334cbfd650ae56f" title="system cannot determine priority or thread has illegal priority.">osErrorPriority</a>         =  0x84,       <span class="comment">///&lt; system cannot determine priority or thread has illegal priority.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eaf1fac0240218e51eb30a13da2f8aae81" title="system is out of memory: it was impossible to allocate or reserve memory for the operation.">osErrorNoMemory</a>         =  0x85,       <span class="comment">///&lt; system is out of memory: it was impossible to allocate or reserve memory for the operation.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea4672c8a0c0f6bb1d7981da4602e8e9ee" title="value of a parameter is out of range.">osErrorValue</a>            =  0x86,       <span class="comment">///&lt; value of a parameter is out of range.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99ea5fde24ff588ec5ab9cb8314bade26fbc" title="unspecified RTOS error: run-time error but no other error message fits.">osErrorOS</a>               =  0xFF,       <span class="comment">///&lt; unspecified RTOS error: run-time error but no other error message fits.</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99eac7a77f5fe18a15a357790c36a4aca1b1" title="prevent from enum down-size compiler optimization.">os_status_reserved</a>      =  0x7FFFFFFF  <span class="comment">///&lt; prevent from enum down-size compiler optimization.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>;</div>
<div class="line"> </div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Timer type value for the timer definition.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b os_timer_type shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span>  {</div>
<div class="line">  <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951" title="one-shot timer">osTimerOnce</a>             =     0,       <span class="comment">///&lt; one-shot timer</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788" title="repeating timer">osTimerPeriodic</a>         =     1        <span class="comment">///&lt; repeating timer</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gadac860eb9e1b4b0619271e6595ed83d9">os_timer_type</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Entry point of a thread.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b os_pthread shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> void (*<a class="code" href="cmsis__os_8h.html#aee631e5ea1b700fc35695cc7bc574cf7" title="Entry point of a thread.">os_pthread</a>) (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Entry point of a timer call back function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b os_ptimer shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> void (*<a class="code" href="cmsis__os_8h.html#aa2d85e49bde9f6951ff3545cd323f065" title="Entry point of a timer call back function.">os_ptimer</a>) (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// &gt;&gt;&gt; the following data type definitions may shall adapted towards a specific RTOS</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Thread ID identifies the thread (pointer to a thread control block).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_thread_cb is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_thread_cb *<a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f" title="Thread ID identifies the thread (pointer to a thread control block).">osThreadId</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Timer ID identifies the timer (pointer to a timer control block).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_timer_cb is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_timer_cb *<a class="code" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7" title="Timer ID identifies the timer (pointer to a timer control block).">osTimerId</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Mutex ID identifies the mutex (pointer to a mutex control block).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_mutex_cb is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_mutex_cb *<a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2" title="Mutex ID identifies the mutex (pointer to a mutex control block).">osMutexId</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Semaphore ID identifies the semaphore (pointer to a semaphore control block).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_semaphore_cb is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_semaphore_cb *<a class="code" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84" title="Semaphore ID identifies the semaphore (pointer to a semaphore control block).">osSemaphoreId</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Pool ID identifies the memory pool (pointer to a memory pool control block).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_pool_cb is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_pool_cb *<a class="code" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686" title="Pool ID identifies the memory pool (pointer to a memory pool control block).">osPoolId</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Message ID identifies the message queue (pointer to a message queue control block).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_messageQ_cb is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_messageQ_cb *<a class="code" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f" title="Message ID identifies the message queue (pointer to a message queue control block).">osMessageQId</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Mail ID identifies the mail queue (pointer to a mail queue control block).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_mailQ_cb is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_mailQ_cb *<a class="code" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5" title="Mail ID identifies the mail queue (pointer to a mail queue control block).">osMailQId</a>;</div>
<div class="line"> </div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Thread Definition structure contains startup information of a thread.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_thread_def is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_thread_def  {</div>
<div class="line">  <a class="code" href="cmsis__os_8h.html#aee631e5ea1b700fc35695cc7bc574cf7" title="Entry point of a thread.">os_pthread</a>               pthread;    <span class="comment">///&lt; start address of thread function</span></div>
<div class="line"><span class="comment"></span>  <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a>             tpriority;    <span class="comment">///&lt; initial thread priority</span></div>
<div class="line"><span class="comment"></span>  uint32_t               instances;    <span class="comment">///&lt; maximum number of instances of that thread function</span></div>
<div class="line"><span class="comment"></span>  uint32_t               stacksize;    <span class="comment">///&lt; stack size requirements in bytes; 0 is default stack size</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="structos_thread_def__t.html" title="Thread Definition structure contains startup information of a thread.">osThreadDef_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Timer Definition structure contains timer parameters.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_timer_def is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_timer_def  {</div>
<div class="line">  <a class="code" href="cmsis__os_8h.html#aa2d85e49bde9f6951ff3545cd323f065" title="Entry point of a timer call back function.">os_ptimer</a>                 ptimer;    <span class="comment">///&lt; start address of a timer function</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="structos_timer_def__t.html" title="Timer Definition structure contains timer parameters.">osTimerDef_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Mutex Definition structure contains setup information for a mutex.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_mutex_def is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_mutex_def  {</div>
<div class="line">  uint32_t                   dummy;    <span class="comment">///&lt; dummy value.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="structos_mutex_def__t.html" title="Mutex Definition structure contains setup information for a mutex.">osMutexDef_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Semaphore Definition structure contains setup information for a semaphore.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_semaphore_def is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_semaphore_def  {</div>
<div class="line">  uint32_t                   dummy;    <span class="comment">///&lt; dummy value.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="structos_semaphore_def__t.html" title="Semaphore Definition structure contains setup information for a semaphore.">osSemaphoreDef_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Definition structure for memory block allocation.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_pool_def is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_pool_def  {</div>
<div class="line">  uint32_t                 pool_sz;    <span class="comment">///&lt; number of items (elements) in the pool</span></div>
<div class="line"><span class="comment"></span>  uint32_t                 item_sz;    <span class="comment">///&lt; size of an item</span></div>
<div class="line"><span class="comment"></span>  <span class="keywordtype">void</span>                       *pool;    <span class="comment">///&lt; pointer to memory for pool</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="structos_pool_def__t.html" title="Definition structure for memory block allocation.">osPoolDef_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Definition structure for message queue.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_messageQ_def is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_messageQ_def  {</div>
<div class="line">  uint32_t                queue_sz;    <span class="comment">///&lt; number of elements in the queue</span></div>
<div class="line"><span class="comment"></span>  uint32_t                 item_sz;    <span class="comment">///&lt; size of an item</span></div>
<div class="line"><span class="comment"></span>  <span class="keywordtype">void</span>                       *pool;    <span class="comment">///&lt; memory array for messages</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="structos_message_q_def__t.html" title="Definition structure for message queue.">osMessageQDef_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Definition structure for mail queue.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: \b os_mailQ_def is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>os_mailQ_def  {</div>
<div class="line">  uint32_t                queue_sz;    <span class="comment">///&lt; number of elements in the queue</span></div>
<div class="line"><span class="comment"></span>  uint32_t                 item_sz;    <span class="comment">///&lt; size of an item</span></div>
<div class="line"><span class="comment"></span>  <span class="keywordtype">void</span>                       *pool;    <span class="comment">///&lt; memory array for mail</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="structos_mail_q_def__t.html" title="Definition structure for mail queue.">osMailQDef_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Event structure contains detailed information about an event.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b os_event shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment">///       However the struct may be extended at the end.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct  </span>{</div>
<div class="line">  <a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>                 status;     <span class="comment">///&lt; status code: event or error information</span></div>
<div class="line"><span class="comment"></span>  <span class="keyword">union  </span>{</div>
<div class="line">    uint32_t                    v;     <span class="comment">///&lt; message as 32-bit value</span></div>
<div class="line"><span class="comment"></span>    <span class="keywordtype">void</span>                       *p;     <span class="comment">///&lt; message or mail as void pointer</span></div>
<div class="line"><span class="comment"></span>    int32_t               signals;     <span class="comment">///&lt; signal flags</span></div>
<div class="line"><span class="comment"></span>  } value;                             <span class="comment">///&lt; event value</span></div>
<div class="line"><span class="comment"></span>  <span class="keyword">union  </span>{</div>
<div class="line">    osMailQId             mail_id;     <span class="comment">///&lt; mail id obtained by \ref osMailCreate</span></div>
<div class="line"><span class="comment"></span>    osMessageQId       message_id;     <span class="comment">///&lt; message id obtained by \ref osMessageCreate</span></div>
<div class="line"><span class="comment"></span>  } def;                               <span class="comment">///&lt; event definition</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group___c_m_s_i_s___r_t_o_s___definitions.html#structos_event" title="Event structure contains detailed information about an event.">osEvent</a>;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Kernel Control Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Initialize the RTOS Kernel for creating objects.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osKernelInitialize shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga53d078a801022e202e8115c083ece68e" title="Initialize the RTOS Kernel for creating objects.">osKernelInitialize</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Start the RTOS Kernel.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osKernelStart shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2" title="Start the RTOS Kernel.">osKernelStart</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Check if the RTOS kernel is already started.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osKernelRunning shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment">/// \return 0 RTOS is not started, 1 RTOS is started.</span></div>
<div class="line"><span class="comment"></span>int32_t <a class="code" href="group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#ga3b571de44cd3094c643247a7397f86b5" title="Check if the RTOS kernel is already started.">osKernelRunning</a>(<span class="keywordtype">void</span>);</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#if (defined (osFeature_SysTick)  &amp;&amp;  (osFeature_SysTick != 0))     // System Timer available</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the RTOS kernel system timer counter </span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osKernelSysTick shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment">/// \return RTOS kernel system timer as 32-bit value </span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group___c_m_s_i_s___r_t_o_s___kernel_ctrl.html#gad0262e4688e95d1e9038afd9bcc16001" title="Get the RTOS kernel system timer counter.">osKernelSysTick</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// The RTOS kernel system timer frequency in Hz</span></div>
<div class="line"><span class="comment">/// \note Reflects the system timer setting and is typically defined in a configuration file.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osKernelSysTickFrequency 100000000</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Convert a microseconds value to a RTOS kernel system timer value.</span></div>
<div class="line"><span class="comment">/// \param         microsec     time value in microseconds.</span></div>
<div class="line"><span class="comment">/// \return time value normalized to the \ref osKernelSysTickFrequency</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osKernelSysTickMicroSec(microsec) (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000)</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="preprocessor">#endif    // System Timer available</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="comment">//  ==== Thread Management ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create a Thread Definition with function, priority, and stack requirements.</span></div>
<div class="line"><span class="comment">/// \param         name         name of the thread function.</span></div>
<div class="line"><span class="comment">/// \param         priority     initial priority of the thread function.</span></div>
<div class="line"><span class="comment">/// \param         instances    number of possible thread instances.</span></div>
<div class="line"><span class="comment">/// \param         stacksz      stack size (in bytes) requirements for the thread function.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameters to \b osThreadDef shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#if defined (osObjectsExternal)  // object is external</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osThreadDef(name, priority, instances, stacksz)  \</span></div>
<div class="line"><span class="preprocessor">extern const osThreadDef_t os_thread_def_##name</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else                            // define the object</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osThreadDef(name, priority, instances, stacksz)  \</span></div>
<div class="line"><span class="preprocessor">const osThreadDef_t os_thread_def_##name = \</span></div>
<div class="line"><span class="preprocessor">{ (name), (priority), (instances), (stacksz)  }</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Access a Thread definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the thread definition object.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osThread shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osThread(name)  \</span></div>
<div class="line"><span class="preprocessor">&amp;os_thread_def_##name</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create a thread and add it to Active Threads and set it to state READY.</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_def    thread definition referenced with \ref osThread.</span></div>
<div class="line"><span class="comment">/// \param[in]     argument      pointer that is passed to the thread function as start argument.</span></div>
<div class="line"><span class="comment">/// \return thread ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osThreadCreate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osThreadId <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gac59b5713cb083702dce759c73fd90dff" title="Create a thread and add it to Active Threads and set it to state READY.">osThreadCreate</a> (<span class="keyword">const</span> <a class="code" href="structos_thread_def__t.html" title="Thread Definition structure contains startup information of a thread.">osThreadDef_t</a> *thread_def, <span class="keywordtype">void</span> *argument);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Return the thread ID of the current running thread.</span></div>
<div class="line"><span class="comment">/// \return thread ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osThreadGetId shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osThreadId <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7" title="Return the thread ID of the current running thread.">osThreadGetId</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Terminate execution of a thread and remove it from Active Threads.</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_id   thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osThreadTerminate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gaea135bb90eb853eff39e0800b91bbeab" title="Terminate execution of a thread and remove it from Active Threads.">osThreadTerminate</a> (osThreadId thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Pass control to next thread that is in state \b READY.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osThreadYield shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#gaf13a667493c5d629a90c13e113b99233" title="Pass control to next thread that is in state READY.">osThreadYield</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Change priority of an active thread.</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_id     thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \param[in]     priority      new priority value for the thread function.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osThreadSetPriority shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b" title="Change priority of an active thread.">osThreadSetPriority</a> (osThreadId thread_id, <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> priority);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get current priority of an active thread.</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_id     thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return current priority value of the thread function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osThreadGetPriority shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___thread_mgmt.html#ga4299d838978bc2aae5e4350754e6a4e9" title="Get current priority of an active thread.">osThreadGetPriority</a> (osThreadId thread_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Generic Wait Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait for Timeout (Time Delay).</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue &quot;time delay&quot; value</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___wait.html#ga02e19d5e723bfb06ba9324d625162255" title="Wait for Timeout (Time Delay).">osDelay</a> (uint32_t millisec);</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#if (defined (osFeature_Wait)  &amp;&amp;  (osFeature_Wait != 0))     // Generic Wait available</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait for Signal, Message, Mail, or Timeout.</span></div>
<div class="line"><span class="comment">/// \param[in] millisec          \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out</span></div>
<div class="line"><span class="comment">/// \return event that contains signal, message, or mail information or error code.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osWait shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___definitions.html#structos_event" title="Event structure contains detailed information about an event.">osEvent</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___wait.html#ga8470c8aaedfde524a44e22e5b2328285" title="Wait for Signal, Message, Mail, or Timeout.">osWait</a> (uint32_t millisec);</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif  // Generic Wait available</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Timer Management Functions ====</span><span class="comment"></span></div>
<div class="line"><span class="comment">/// Define a Timer object.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the timer object.</span></div>
<div class="line"><span class="comment">/// \param         function      name of the timer call back function.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osTimerDef shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#if defined (osObjectsExternal)  // object is external</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osTimerDef(name, function)  \</span></div>
<div class="line"><span class="preprocessor">extern const osTimerDef_t os_timer_def_##name</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else                            // define the object</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osTimerDef(name, function)  \</span></div>
<div class="line"><span class="preprocessor">const osTimerDef_t os_timer_def_##name = \</span></div>
<div class="line"><span class="preprocessor">{ (function) }</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Access a Timer definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the timer object.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osTimer shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osTimer(name) \</span></div>
<div class="line"><span class="preprocessor">&amp;os_timer_def_##name</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create a timer.</span></div>
<div class="line"><span class="comment">/// \param[in]     timer_def     timer object referenced with \ref osTimer.</span></div>
<div class="line"><span class="comment">/// \param[in]     type          osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.</span></div>
<div class="line"><span class="comment">/// \param[in]     argument      argument to the timer call back function.</span></div>
<div class="line"><span class="comment">/// \return timer ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osTimerCreate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osTimerId <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6" title="Create a timer.">osTimerCreate</a> (<span class="keyword">const</span> <a class="code" href="structos_timer_def__t.html" title="Timer Definition structure contains timer parameters.">osTimerDef_t</a> *timer_def, <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#gadac860eb9e1b4b0619271e6595ed83d9">os_timer_type</a> type, <span class="keywordtype">void</span> *argument);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Start or restart a timer.</span></div>
<div class="line"><span class="comment">/// \param[in]     timer_id      timer ID obtained by \ref osTimerCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue &quot;time delay&quot; value of the timer.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osTimerStart shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga27a797a401b068e2644d1125f22a07ca" title="Start or restart a timer.">osTimerStart</a> (osTimerId timer_id, uint32_t millisec);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Stop the timer.</span></div>
<div class="line"><span class="comment">/// \param[in]     timer_id      timer ID obtained by \ref osTimerCreate.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osTimerStop shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga58f36b121a812936435cacc6e1e0e091" title="Stop the timer.">osTimerStop</a> (osTimerId timer_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a timer that was created by \ref osTimerCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     timer_id      timer ID obtained by \ref osTimerCreate.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osTimerDelete shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___timer_mgmt.html#ga746b8043d906849bd65e3900fcb483cf" title="Delete a timer that was created by osTimerCreate.">osTimerDelete</a> (osTimerId timer_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Signal Management ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Set the specified Signal Flags of an active thread.</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_id     thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \param[in]     signals       specifies the signal flags of the thread that should be set.</span></div>
<div class="line"><span class="comment">/// \return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osSignalSet shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>int32_t <a class="code" href="group___c_m_s_i_s___r_t_o_s___signal_mgmt.html#ga3de2730654589d6c3559c4b9e2825553" title="Set the specified Signal Flags of an active thread.">osSignalSet</a> (osThreadId thread_id, int32_t signals);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Clear the specified Signal Flags of an active thread.</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_id     thread ID obtained by \ref osThreadCreate or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \param[in]     signals       specifies the signal flags of the thread that shall be cleared.</span></div>
<div class="line"><span class="comment">/// \return previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters or call from ISR.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osSignalClear shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>int32_t <a class="code" href="group___c_m_s_i_s___r_t_o_s___signal_mgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6" title="Clear the specified Signal Flags of an active thread.">osSignalClear</a> (osThreadId thread_id, int32_t signals);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait for one or more Signal Flags to become signaled for the current \b RUNNING thread.</span></div>
<div class="line"><span class="comment">/// \param[in]     signals       wait until all specified signal flags set or 0 for any single signal flag.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return event flag information or error code.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osSignalWait shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___definitions.html#structos_event" title="Event structure contains detailed information about an event.">osEvent</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___signal_mgmt.html#ga38860acda96df47da6923348d96fc4c9" title="Wait for one or more Signal Flags to become signaled for the current RUNNING thread.">osSignalWait</a> (int32_t signals, uint32_t millisec);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Mutex Management ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Define a Mutex.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the mutex object.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osMutexDef shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#if defined (osObjectsExternal)  // object is external</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osMutexDef(name)  \</span></div>
<div class="line"><span class="preprocessor">extern const osMutexDef_t os_mutex_def_##name</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else                            // define the object</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osMutexDef(name)  \</span></div>
<div class="line"><span class="preprocessor">const osMutexDef_t os_mutex_def_##name = { 0 }</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Access a Mutex definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the mutex object.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osMutex shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osMutex(name)  \</span></div>
<div class="line"><span class="preprocessor">&amp;os_mutex_def_##name</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a Mutex object.</span></div>
<div class="line"><span class="comment">/// \param[in]     mutex_def     mutex definition referenced with \ref osMutex.</span></div>
<div class="line"><span class="comment">/// \return mutex ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMutexCreate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osMutexId <a class="code" href="group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga5c9de56e717016e39e788064e9a291cc" title="Create and Initialize a Mutex object.">osMutexCreate</a> (<span class="keyword">const</span> <a class="code" href="structos_mutex_def__t.html" title="Mutex Definition structure contains setup information for a mutex.">osMutexDef_t</a> *mutex_def);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait until a Mutex becomes available.</span></div>
<div class="line"><span class="comment">/// \param[in]     mutex_id      mutex ID obtained by \ref osMutexCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMutexWait shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13" title="Wait until a Mutex becomes available.">osMutexWait</a> (osMutexId mutex_id, uint32_t millisec);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Release a Mutex that was obtained by \ref osMutexWait.</span></div>
<div class="line"><span class="comment">/// \param[in]     mutex_id      mutex ID obtained by \ref osMutexCreate.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMutexRelease shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#ga006e4744d741e8e132c3d5bbc295afe1" title="Release a Mutex that was obtained by osMutexWait.">osMutexRelease</a> (osMutexId mutex_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a Mutex that was created by \ref osMutexCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     mutex_id      mutex ID obtained by \ref osMutexCreate.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMutexDelete shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___mutex_mgmt.html#gac27e24135185d51d18f3dabc20910219" title="Delete a Mutex that was created by osMutexCreate.">osMutexDelete</a> (osMutexId mutex_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Semaphore Management Functions ====</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#if (defined (osFeature_Semaphore)  &amp;&amp;  (osFeature_Semaphore != 0))     // Semaphore available</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Define a Semaphore object.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the semaphore object.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osSemaphoreDef shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#if defined (osObjectsExternal)  // object is external</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osSemaphoreDef(name)  \</span></div>
<div class="line"><span class="preprocessor">extern const osSemaphoreDef_t os_semaphore_def_##name</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else                            // define the object</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osSemaphoreDef(name)  \</span></div>
<div class="line"><span class="preprocessor">const osSemaphoreDef_t os_semaphore_def_##name = { 0 }</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Access a Semaphore definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the semaphore object.</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osSemaphore shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osSemaphore(name)  \</span></div>
<div class="line"><span class="preprocessor">&amp;os_semaphore_def_##name</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a Semaphore object used for managing resources.</span></div>
<div class="line"><span class="comment">/// \param[in]     semaphore_def semaphore definition referenced with \ref osSemaphore.</span></div>
<div class="line"><span class="comment">/// \param[in]     count         number of available resources.</span></div>
<div class="line"><span class="comment">/// \return semaphore ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osSemaphoreCreate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osSemaphoreId <a class="code" href="group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#ga97381e8e55cd47cec390bf57c96d6edb" title="Create and Initialize a Semaphore object used for managing resources.">osSemaphoreCreate</a> (<span class="keyword">const</span> <a class="code" href="structos_semaphore_def__t.html" title="Semaphore Definition structure contains setup information for a semaphore.">osSemaphoreDef_t</a> *semaphore_def, int32_t count);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait until a Semaphore token becomes available.</span></div>
<div class="line"><span class="comment">/// \param[in]     semaphore_id  semaphore object referenced with \ref osSemaphoreCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return number of available tokens, or -1 in case of incorrect parameters.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osSemaphoreWait shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>int32_t <a class="code" href="group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#gacc15b0fc8ce1167fe43da33042e62098" title="Wait until a Semaphore token becomes available.">osSemaphoreWait</a> (osSemaphoreId semaphore_id, uint32_t millisec);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Release a Semaphore token.</span></div>
<div class="line"><span class="comment">/// \param[in]     semaphore_id  semaphore object referenced with \ref osSemaphoreCreate.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osSemaphoreRelease shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#gab108914997c49e14d8ff1ae0d1988ca0" title="Release a Semaphore token.">osSemaphoreRelease</a> (osSemaphoreId semaphore_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a Semaphore that was created by \ref osSemaphoreCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     semaphore_id  semaphore object referenced with \ref osSemaphoreCreate.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osSemaphoreDelete shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___semaphore_mgmt.html#gabae2801ac2c096f6e8c69a264908f595" title="Delete a Semaphore that was created by osSemaphoreCreate.">osSemaphoreDelete</a> (osSemaphoreId semaphore_id);</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif     // Semaphore available</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Memory Pool Management Functions ====</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#if (defined (osFeature_Pool)  &amp;&amp;  (osFeature_Pool != 0))  // Memory Pool Management available</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Define a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the memory pool.</span></div>
<div class="line"><span class="comment">/// \param         no            maximum number of blocks (objects) in the memory pool.</span></div>
<div class="line"><span class="comment">/// \param         type          data type of a single block (object).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osPoolDef shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#if defined (osObjectsExternal)  // object is external</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osPoolDef(name, no, type)   \</span></div>
<div class="line"><span class="preprocessor">extern const osPoolDef_t os_pool_def_##name</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else                            // define the object</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osPoolDef(name, no, type)   \</span></div>
<div class="line"><span class="preprocessor">const osPoolDef_t os_pool_def_##name = \</span></div>
<div class="line"><span class="preprocessor">{ (no), sizeof(type), NULL }</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Access a Memory Pool definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the memory pool</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osPool shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osPool(name) \</span></div>
<div class="line"><span class="preprocessor">&amp;os_pool_def_##name</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a memory pool.</span></div>
<div class="line"><span class="comment">/// \param[in]     pool_def      memory pool definition referenced with \ref osPool.</span></div>
<div class="line"><span class="comment">/// \return memory pool ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osPoolCreate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osPoolId <a class="code" href="group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a" title="Create and Initialize a memory pool.">osPoolCreate</a> (<span class="keyword">const</span> <a class="code" href="structos_pool_def__t.html" title="Definition structure for memory block allocation.">osPoolDef_t</a> *pool_def);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Allocate a memory block from a memory pool.</span></div>
<div class="line"><span class="comment">/// \param[in]     pool_id       memory pool ID obtain referenced with \ref osPoolCreate.</span></div>
<div class="line"><span class="comment">/// \return address of the allocated memory block or NULL in case of no memory available.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osPoolAlloc shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> *<a class="code" href="group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543" title="Allocate a memory block from a memory pool.">osPoolAlloc</a> (osPoolId pool_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Allocate a memory block from a memory pool and set memory block to zero.</span></div>
<div class="line"><span class="comment">/// \param[in]     pool_id       memory pool ID obtain referenced with \ref osPoolCreate.</span></div>
<div class="line"><span class="comment">/// \return address of the allocated memory block or NULL in case of no memory available.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osPoolCAlloc shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> *<a class="code" href="group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga9f129fcad4730fbd1048ad4fa262f36a" title="Allocate a memory block from a memory pool and set memory block to zero.">osPoolCAlloc</a> (osPoolId pool_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Return an allocated memory block back to a specific memory pool.</span></div>
<div class="line"><span class="comment">/// \param[in]     pool_id       memory pool ID obtain referenced with \ref osPoolCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     block         address of the allocated memory block that is returned to the memory pool.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osPoolFree shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___pool_mgmt.html#ga4a861e9c469c9d0daf5721bf174f8e54" title="Return an allocated memory block back to a specific memory pool.">osPoolFree</a> (osPoolId pool_id, <span class="keywordtype">void</span> *block);</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif   // Memory Pool Management available</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Message Queue Management Functions ====</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#if (defined (osFeature_MessageQ)  &amp;&amp;  (osFeature_MessageQ != 0))     // Message Queues available</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Create a Message Queue Definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the queue.</span></div>
<div class="line"><span class="comment">/// \param         queue_sz      maximum number of messages in the queue.</span></div>
<div class="line"><span class="comment">/// \param         type          data type of a single message element (for debugger).</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osMessageQDef shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#if defined (osObjectsExternal)  // object is external</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osMessageQDef(name, queue_sz, type)   \</span></div>
<div class="line"><span class="preprocessor">extern const osMessageQDef_t os_messageQ_def_##name</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else                            // define the object</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osMessageQDef(name, queue_sz, type)   \</span></div>
<div class="line"><span class="preprocessor">const osMessageQDef_t os_messageQ_def_##name = \</span></div>
<div class="line"><span class="preprocessor">{ (queue_sz), sizeof (type)  }</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Access a Message Queue Definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the queue</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osMessageQ shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osMessageQ(name) \</span></div>
<div class="line"><span class="preprocessor">&amp;os_messageQ_def_##name</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a Message Queue.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_def     queue definition referenced with \ref osMessageQ.</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_id     thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.</span></div>
<div class="line"><span class="comment">/// \return message queue ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMessageCreate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osMessageQId <a class="code" href="group___c_m_s_i_s___r_t_o_s___message.html#gaf3b9345cf426304d46565152bc26fb78" title="Create and Initialize a Message Queue.">osMessageCreate</a> (<span class="keyword">const</span> <a class="code" href="structos_message_q_def__t.html" title="Definition structure for message queue.">osMessageQDef_t</a> *queue_def, osThreadId thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Put a Message to a Queue.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_id      message queue ID obtained with \ref osMessageCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     info          message information.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMessagePut shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___message.html#gac0dcf462fc92de8ffaba6cc004514a6d" title="Put a Message to a Queue.">osMessagePut</a> (osMessageQId queue_id, uint32_t info, uint32_t millisec);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get a Message or Wait for a Message from a Queue.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_id      message queue ID obtained with \ref osMessageCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return event information that includes status code.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMessageGet shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___definitions.html#structos_event" title="Event structure contains detailed information about an event.">osEvent</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___message.html#ga6c6892b8f2296cca6becd57ca2d7e1ae" title="Get a Message or Wait for a Message from a Queue.">osMessageGet</a> (osMessageQId queue_id, uint32_t millisec);</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif     // Message Queues available</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> </div>
<div class="line"><span class="comment">//  ==== Mail Queue Management Functions ====</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#if (defined (osFeature_MailQ)  &amp;&amp;  (osFeature_MailQ != 0))     // Mail Queues available</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Create a Mail Queue Definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the queue</span></div>
<div class="line"><span class="comment">/// \param         queue_sz      maximum number of messages in queue</span></div>
<div class="line"><span class="comment">/// \param         type          data type of a single message element</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osMailQDef shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#if defined (osObjectsExternal)  // object is external</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osMailQDef(name, queue_sz, type) \</span></div>
<div class="line"><span class="preprocessor">extern const osMailQDef_t os_mailQ_def_##name</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else                            // define the object</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define osMailQDef(name, queue_sz, type) \</span></div>
<div class="line"><span class="preprocessor">const osMailQDef_t os_mailQ_def_##name =  \</span></div>
<div class="line"><span class="preprocessor">{ (queue_sz), sizeof (type) }</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \brief Access a Mail Queue Definition.</span></div>
<div class="line"><span class="comment">/// \param         name          name of the queue</span></div>
<div class="line"><span class="comment">/// \note CAN BE CHANGED: The parameter to \b osMailQ shall be consistent but the</span></div>
<div class="line"><span class="comment">///       macro body is implementation specific in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osMailQ(name)  \</span></div>
<div class="line"><span class="preprocessor">&amp;os_mailQ_def_##name</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize mail queue.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_def     reference to the mail queue definition obtain with \ref osMailQ</span></div>
<div class="line"><span class="comment">/// \param[in]     thread_id     thread ID (obtained by \ref osThreadCreate or \ref osThreadGetId) or NULL.</span></div>
<div class="line"><span class="comment">/// \return mail queue ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMailCreate shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span>osMailQId <a class="code" href="group___c_m_s_i_s___r_t_o_s___mail.html#gaa177e7fe5820dd70d8c9e46ded131174" title="Create and Initialize mail queue.">osMailCreate</a> (<span class="keyword">const</span> <a class="code" href="structos_mail_q_def__t.html" title="Definition structure for mail queue.">osMailQDef_t</a> *queue_def, osThreadId thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Allocate a memory block from a mail.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_id      mail queue ID obtained with \ref osMailCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out</span></div>
<div class="line"><span class="comment">/// \return pointer to memory block that can be filled with mail or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMailAlloc shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> *<a class="code" href="group___c_m_s_i_s___r_t_o_s___mail.html#gadf5ce811bd6a56e617e902a1db6c2194" title="Allocate a memory block from a mail.">osMailAlloc</a> (osMailQId queue_id, uint32_t millisec);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Allocate a memory block from a mail and set memory block to zero.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_id      mail queue ID obtained with \ref osMailCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out</span></div>
<div class="line"><span class="comment">/// \return pointer to memory block that can be filled with mail or NULL in case of error.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMailCAlloc shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> *<a class="code" href="group___c_m_s_i_s___r_t_o_s___mail.html#ga8fde74f6fe5b9e88f75cc5eb8f2124fd" title="Allocate a memory block from a mail and set memory block to zero.">osMailCAlloc</a> (osMailQId queue_id, uint32_t millisec);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Put a mail to a queue.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_id      mail queue ID obtained with \ref osMailCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     mail          memory block previously allocated with \ref osMailAlloc or \ref osMailCAlloc.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMailPut shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___mail.html#ga485ef6f81854ebda8ffbce4832181e02" title="Put a mail to a queue.">osMailPut</a> (osMailQId queue_id, <span class="keywordtype">void</span> *mail);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get a mail from a queue.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_id      mail queue ID obtained with \ref osMailCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     millisec      \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out</span></div>
<div class="line"><span class="comment">/// \return event that contains mail information or error code.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMailGet shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___definitions.html#structos_event" title="Event structure contains detailed information about an event.">osEvent</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd" title="Get a mail from a queue.">osMailGet</a> (osMailQId queue_id, uint32_t millisec);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Free a memory block from a mail.</span></div>
<div class="line"><span class="comment">/// \param[in]     queue_id      mail queue ID obtained with \ref osMailCreate.</span></div>
<div class="line"><span class="comment">/// \param[in]     mail          pointer to the memory block that was obtained with \ref osMailGet.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment">/// \note MUST REMAIN UNCHANGED: \b osMailFree shall be consistent in every CMSIS-RTOS.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group___c_m_s_i_s___r_t_o_s___status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> <a class="code" href="group___c_m_s_i_s___r_t_o_s___mail.html#ga27c1060cf21393f96b4fd1ed1c0167cc" title="Free a memory block from a mail.">osMailFree</a> (osMailQId queue_id, <span class="keywordtype">void</span> *mail);</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif  // Mail Queues available</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifdef  __cplusplus</span></div>
<div class="line"><span class="preprocessor"></span>}</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="preprocessor">#endif  // _CMSIS_OS_H</span></div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Tue Oct 27 2015 14:35:43 for CMSIS-RTOS by ARM Ltd. All rights reserved.
	<!--
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 
	-->
	</li>
  </ul>
</div>
</body>
</html>
